package com.topisv.tms.repository;


import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.topisv.tms.entity.LogisticsCompany;
import com.topisv.tms.entity.LogisticsMailNo;
import com.topisv.tms.entity.ViewLogisticsCompanyNO;

/**
 * 管理物流公司的Dao
 * @author Administrator
 *
 */
public interface LogisticsCompanyDao extends PagingAndSortingRepository<LogisticsCompany, Long>,JpaSpecificationExecutor<LogisticsCompany>{

	List<LogisticsCompany> findAll();

	@Query("select c from LogisticsCompany c where c.companyCode=?")
	LogisticsCompany findCompanyByCode(String companyCode);
	
	@Query("select c from LogisticsCompany c")
	List<LogisticsCompany> findCompanyNameAndCode();
	
	@Query("select c from ViewLogisticsCompanyNO c where c.companyCode=?1")
	List<ViewLogisticsCompanyNO> findMailNoByCompanyCode(String companyCode);
	 
} 
